using System;
using System.Collections.Generic;
using System.Text;
namespace Component
{
    public class CFileInfo : System.Web.UI.Page
    {
        public CFileInfo(string fileName, string extend, string url, string size, string dateModified)
        {
            FileName = fileName;
            Extend = extend;
            Url = url;
            Size = size;
            DateModified = dateModified;
        }
        string url = "";
        string fileName = "";
        string extend = "";
        string _size = "";
        public string Url
        {
            get { return url; }
            set { url = value; }
        }
        public string Size
        {
            get { return _size; }
            set { _size = value; }
        }
        public string Extend
        {
            get { return extend.ToLower(); }
            set { extend = value; }
        }
        public string FileName
        {
            get { return fileName; }
            set { fileName = value; }
        }
      //  Show All File Image, Flash , Media
        public string ShowFile
        {
            get
            {
                if (Config.ImageFile().Contains(Extend))
                    return @"<img src=""" + "../FileUpload" + url + @""" width=""80px"" height = ""80px"" border=""0px"" />";
                else if (Config.FlashFile().Contains(Extend))
                    return @"<img src=""" + @"Images/Admin/images/icons/swf.jpg"" width=""50px"" height = ""50px"" border=""0px"" />";
                else if (Config.MediaFile().Contains(Extend))
                    return @"<img src=""" + @"Images/Admin/images/icons/media.jpg"" width=""50px"" height = ""50px"" border=""0px"" />";
                else if (Config.ArchiveFile().Contains(Extend))
                    return @"<img src=""" + @"Images/Admin/images/icons/zip.jpg"" width=""50px"" height = ""50px"" border=""0px"" />";
                else
                    return "Not define";
            }
        }
        public string ShowFileDetail
        {
            get
            {
                if (Config.ImageFile().Contains(Extend))
                    return @"<img src=""" + @"../FileUpload" + url + @""" width=""20px"" height = ""20px"" border=""0px"" /> ";
                else if (Config.FlashFile().Contains(Extend))
                    return @"<img src=""" + @"Images/Admin/images/icons/swf.jpg"" width=""20px"" height = ""20px"" border=""0px"" /> ";
                else if (Config.MediaFile().Contains(Extend))
                    return @"<img src=""" + @"Images/Admin/images/icons/media.jpg"" width=""20px"" height = ""20px"" border=""0px"" /> ";
                else if (Config.ArchiveFile().Contains(Extend))
                    return @"<img src=""" + @"Images/Admin/images/icons/zip.jpg"" width=""20px"" height = ""20px"" border=""0px"" /> ";
                else
                    return @"<img src=""" + @"Images/Admin/Images/Icons/FileManager/Icons/" + this.extend + @".gif"" width=""20px"" height = ""20px"" border=""0px"" /> ";
            }
        }
        public string ShowFileManager
        {
            get
            {
                try
                {
                    return @"<img src=""" + @"Images/Admin/Images/Icons/FileManager/Icons/" + Extend + @".gif"" width=""16px"" height = ""16px"" />";
                }
                catch
                {
                    return "Not define";
                }
            }
        }
        string _dateModified = "";
        public string DateModified
        {
            get { return _dateModified; }
            set { _dateModified = value; }
        }


    }
}